#ifndef LOGIN_H
#define LOGIN_H

#include <QWidget>
#include <QLineEdit>
#include <QPushButton>
#include <QLabel>
#include <QSqlDatabase>
#include <QSqlError>
#include <QDebug>
#include <QMessageBox>
#include <QCheckBox>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QFormLayout>
#include <QApplication>
#include <QSqlQuery>


class Login : public QWidget
{
    Q_OBJECT
private:
    QSqlDatabase db;
    QLineEdit *usernameEdit;
    QLineEdit *passwordEdit;
    QPushButton *loginBtn;
    QPushButton *registerBtn;
    QCheckBox *rememberMe;
    QLabel *titleLabel;
    QLineEdit *confirmPwdEdit;
    QLineEdit *phoneEdit;
    QPushButton *backBtn;
public:
    Login(QWidget *parent = nullptr);
    ~Login();
    bool initDatabase();
    void setupUI();
    void LoginClicked();
signals:
    void loginSuccess(bool isAdmin);
    void loginSuccess2(QString permission);

};
#endif // LOGIN_H
